#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
const ll mod = 1e9 + 7;
ll n;
void solve()
{
    cin >> n;
    ll ans = 0;
    n /= 2;
    cout << (n * 2 + n * (n - 1)) % mod << endl;
}
int main()
{
    ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    int t = 1;
    cin >> t;
    while(t--)
    {
        solve();
    }
   return 0;
}
